<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学IT - 后台管理系统</title>
    <?php include( './views/common/style.html' ) ?>
</head>
<body>
    
    <!-- 侧边栏 -->
    <?php include( './views/common/aside.html' ) ?>
    <!-- 主体 -->
    <div class="main">
        <div class="container-fluid">
            <!-- 头部 -->
            <?php include( './views/common/header.html' ) ?>
            <!-- 讲师列表 -->
            <div class="body teacher-list">
                <!-- 面包屑 -->
                <ol class="breadcrumb">
                    <li><a href="javascript:;">讲师管理</a></li>
                    <li class="active">讲师列表</li>
                </ol>
                <div class="page-title">
                    <a href="/teacher/add" class="btn btn-success btn-sm pull-right">添加讲师</a>
                </div>
                <div class="panel panel-default">
                    <div class="panel-body">
                        <form action="" class="form-inline">
                            <div class="input-group">
                                <input type="text" class="form-control input-sm">
                                <span class="input-group-btn">
                                    <button class="btn btn-success btn-sm">搜索</button>
                                </span>
                            </div>
                        </form>
                    </div>
                    <table id="tableTeacherInfoList" class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <th>编号</th>
                                <th>姓名</th>
                                <th>昵称</th>
                                <th>生日</th>
                                <th>性别</th>
                                <th>手机号码</th>
                                <th>入职时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <!-- 提供讲师数据库 -->
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <!-- 模态框 添加课程 -->
    <div class="modal fade" id="teacherModal">
        <div class="modal-dialog" style="width: 750px;">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="panel-title">讲师信息</h4>
                </div>
                <div class="panel-body">
                    <table id="modalTeacherInfo" class="table table-bordered table-condensed">
                        <!--  -->
                    </table>
                </div>
            </div>
        </div>
    </div>



    <script type="text/template" id="tableTeacherInfoListTpl">
        {{ each list }}
        <tr>
            <td>{{ $index + 1 }}</td>
            <td>{{ $value.tc_name }}</td>
            <td>{{ $value.tc_roster }}</td>
            <td>{{ $value.tc_birthday }}</td>
            <td>{{ $value.tc_gender == 0 ? '男' : '女' }}</td>
            <td>{{ $value.tc_cellphone }}</td>
            <td>{{ $value.tc_join_date }}</td>
            <td data-tc-id="{{ $value.tc_id }}">
                <a href="#teacherModal" 
                   class="showInfo btn btn-info btn-xs">查 看</a>
                <a href="/teacher/add?tc_id={{ $value.tc_id }}" 
                   class="editInfo btn btn-info btn-xs">编 辑</a>
                <a href="javascript:;" 
                   class="status btn btn-warning btn-xs"
                   data-tc-status={{ $value.tc_status }}>
                   {{ if $value.tc_status == 0 }}启 用{{ else }}注 销{{ /if }}
                </a>
            </td>
        </tr>
        {{ /each }}
    </script>

    <script type="text/template" id="teacherInfoTpl">
        <tbody>
            <tr>
                <th>姓名:</th><td>{{ tc_name }}</td>
                <th>职位:</th><td colspan="3">讲师</td>
                <td rowspan="4" width="128">
                    <div class="avatar">
                        <img src="{{ tc_avatar || '/assets/images/default.png' }}" alt="">
                    </div>
                </td>
            </tr>
            <tr>
                <th>花名:</th><td>{{ tc_roster }}</td>
                <th>出生日期:</th><td colspan="3">{{ tc_birthdaty }}</td>
            </tr>
            <tr>
                <th>性别:</th><td>{{ tc_gender == 0 ? '男' : '女' }}</td>
                <th>入职时间:</th><td colspan="3">{{ tc_join_date }}</td>
            </tr>
            <tr>
                <th>手机号码:</th><td colspan="2">{{ tc_cellphone }}</td>
                <th>邮箱:</th><td colspan="2">{{ tc_email }}</td>
            </tr>
            <tr>
                <th>籍贯:</th><td colspan="6">{{ tc_hometown | formatHomeTown }}</td>
            </tr>
            <tr>
                <td colspan="7">
                    <div class="introduce">
                        {{@ tc_introduce }}
                    </div>
                </td>
            </tr>
        </tbody>
    </script>





    <?php include( './views/common/script.html' ) ?>
    <script>    
    require( [ 'teacherList' ] );
    </script>
</body>
</html>